
#pragma once

const std::string UDPCALLBENCH_CONFIG_FILE_NAME = "UdpCallBench.xml";

class UdpCallBenchMgr;

class UdpCallBenchAppConfigure : public asyframe::ConfigureBase
{
public:
	UdpCallBenchAppConfigure();
	virtual ~UdpCallBenchAppConfigure();

	virtual retT init(const std::string _configFileName=DEFAULT_CONFIG_FILE_NAME);

	std::string instanceName_;
	std::size_t dataThreadSize_;
};

//class TestCode
//{
//public:
//	int success_;
//	int fail_;
//	int timeout_;
//	int error_;
//};

class UdpCallBenchApp : public asyframe::AppBase, public virtual asyframe::IUdpAction
{
public:
	UdpCallBenchApp(asyframe::ConfigureBase* _pConfigure = new asyframe::ConfigureBase());
	virtual ~UdpCallBenchApp();

	virtual retT init();

	virtual retT start();

	virtual retT close();

	virtual retT exitInstance();

	void gatherResult(int _success, int _fail, int _timeout, int _error);

	//void setTestCodeSize(std::size_t _testCodeSize);

	//void incSuccess(int _index);
	//void incFail(int _index);
	//void incTimeout(int _index);
	//void incError(int _index);

protected:
	boost::shared_ptr<UdpCallBenchMgr> pUdpCallBenchMgr_;

	int actor_;
	int success_;
	int fail_;
	int timeout_;
	int error_;

	//std::vector<TestCode> testCode_;

	boost::posix_time::ptime startTime_;
	int timeSpan_;
};
